package com.example.myblog.dao;

import com.example.myblog.domain.Blog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: Wu YunXia
 * @Description:
 * @Date: Created in 16:02 2020/11/10
 * @Modefied By:
 */
@Repository
public interface BlogRespository extends JpaRepository<Blog, Integer> {

//    @Select("SELECT * FROM blog")
//    public Blog findByTitle(String keyword);

    List<Blog>findByTitleLikeAndUid(String keyword, int uid);

    List<Blog>findAllByUid(Integer uid);

//    @Select("SELECT * FROM blog join user on blog.uid==user.id where blog.id = #{id}")
//    List<Blog> findAllById(int id);

//select * from A join B on A.AID==B.BID where



}
